package state;

import java.util.ArrayList;

import javax.swing.JOptionPane;


public class Alquiler 
{
	ArrayList<Carro> carros;
	public Alquiler(){
		carros=new ArrayList<Carro>();
		carros.add(new Carro("BMW",2009,2000.00));
		carros.add(new Carro("Clio",2011,1500.00));
		carros.add(new Carro("Mazda",2008,1400.00));
		imprimirInfo();
		desplegarMenu();
	}
	public static void main(String []args){
		new Alquiler();
	}
	public void imprimirInfo(){
		for (int i = 0; i < carros.size(); i++) {
			System.out.println("-----------------------------");
			carros.get(i).MostrarEspecificaciones();
			System.out.println("-----------------------------");
		}
	}
	public void desplegarMenu(){
		String s=null;
		do{		
			s=JOptionPane.showInputDialog("Ingrese el id del carro que le interesa: \n 0.Salir");
			for (int i = 0; i < carros.size(); i++) {
				if(carros.get(i).getIdentificador().equalsIgnoreCase(s)){
					carros.get(i).consultarEstado();
					break;
				}
			}
			imprimirInfo();
		}while(!s.equals("0"));
	}
	

}